package com.example.bbs.util;

public class RedisKeyUtil {
    private static final String LINK = "-"; //连接符

    //热门帖子实时排行
    private static final String HOT_POST_RANK_HOUR_KEY = "hotPostRankHour";
    //存储点赞过该帖子的用户id，用于判断某个用户是否点赞过该帖子
    private static final String POST_LIKE_SET_KEY = "postLikeSet";
    //存储点赞过该评论的用户id，用于判断某个用户是否点赞过该评论
    private static final String COMMENT_LIKE_SET_KEY = "commentLikeSet";
    //存储浏览过该帖子的用户ip，用于判断某个用户是否浏览过该帖子
    private static final String POST_LOOK_SET_KEY = "postLookSet";

    //热门帖子日排行
    public static final String HOT_POST_RANK_DAY_KEY = "hotPostRankDay";
    //热门帖子周排行
    public static final String HOT_POST_RANK_WEEK_KEY = "hotPostRankWeek";
    //（存储新发布，新增回复，新增点赞，新增浏览量的帖子）
    public static final String CHANGED_POST_SET_KEY = "changedPostSet";


    public static String getPostLookSetKey(String postSn) {
        return POST_LOOK_SET_KEY + LINK + postSn;
    }

    public static String getHotPostListHourKey(long currentHour) {
        return HOT_POST_RANK_HOUR_KEY + LINK + currentHour;
    }

    public static String getLikePostSetKey(String postSn) {
        return POST_LIKE_SET_KEY + LINK + postSn;
    }

    public static String getLikeCommentSetKey(String commentSn) {
        return COMMENT_LIKE_SET_KEY + LINK + commentSn;
    }


}
